// 定义抽象的动物类
abstract class Animal {
    protected String name; // 动物的名字
    protected String type; // 动物的种类
    protected String breed; // 动物的品种
    protected double price; // 动物的价格

    // 构造方法
    public Animal(String name, String type, String breed, double price) {
        this.name = name;
        this.type = type;
        this.breed = breed;
        this.price = price;
    }

    // 基本方法：吃饭
    public abstract void eat();

    // 基本方法：睡觉
    public abstract void sleep();

    // 基本方法：玩
    public abstract void play();

    // 基本方法：叫
    public abstract void makeSound();
}

// 小猫类
class Cat extends Animal {
    public Cat(String name, String breed, double price) {
        super(name, "Cat", breed, price);
    }

    @Override
    public void eat() {
        System.out.println(name + " is eating.");
    }

    @Override
    public void sleep() {
        System.out.println(name + " is sleeping.");
    }

    @Override
    public void play() {
        System.out.println(name + " is playing.");
        makeSound(); // 猫在玩的时候会叫
    }

    @Override
    public void makeSound() {
        System.out.println(name + " says: Meow!");
    }
}

// 小狗类
class Dog extends Animal {
    public Dog(String name, String breed, double price) {
        super(name, "Dog", breed, price);
    }

    @Override
    public void eat() {
        System.out.println(name + " is eating.");
    }

    @Override
    public void sleep() {
        System.out.println(name + " is sleeping.");
    }

    @Override
    public void play() {
        System.out.println(name + " is playing.");
    }

    @Override
    public void makeSound() {
        System.out.println(name + " says: Woof!");
    }
}

// 主类和主方法
public class Zoo {
    public static void main(String[] args) {
        // 实例化小猫对象
        Cat cat1 = new Cat("Whiskers", "Siamese", 500.0);
        Cat cat2 = new Cat("Paws", "Maine Coon", 700.0);

        // 实例化小狗对象
        Dog dog1 = new Dog("Buddy", "Golden Retriever", 300.0);
        Dog dog2 = new Dog("Rex", "German Shepherd", 400.0);

        // 调用方法
        cat1.eat();
        cat1.sleep();
        cat1.play();

        cat2.eat();
        cat2.sleep();
        cat2.play();

        dog1.eat();
        dog1.sleep();
        dog1.play();

        dog2.eat();
        dog2.sleep();
        dog2.play();
    }
}